﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using VsSourceCpoy.Entity;
using VsSourceCpoy.Helper;
using System.Xml;
using System.Xml.Linq;

namespace VsSourceCpoy.Service
{
    public class CSharpSolutionFileParser : SolutionFileParserBase
    {

        #region ISolutionFileParser 成员
        public override ParseResult ParseFile(string fileName, Encoding encoding)
        {
            FileInfo fi = new FileInfo(fileName);

            if (".sln".Equals(fi.Extension, StringComparison.OrdinalIgnoreCase))
            {
                return SlnFileParser.ParseSlnFile(fileName, encoding);
            }
            else if (".csproj".Equals(fi.Extension, StringComparison.OrdinalIgnoreCase))
            {
                return SlnFileParser.ParseCsprojFile(fi.FullName, encoding);
            }
            throw new NotImplementedException();
        }
        #endregion
    }
}
